/* header.h
 * 
 * Copyright (C) 3 September, 2005 Priyank Bolia
 * http://www.priyank.in
 * 
 * This code is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This code is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 * MA 02111-1307, USA
 */

#pragma once
#include "operationcategory\base.h"
#include "map"

typedef void (wxEvtHandler::*CategoryChangedEventHandler)(wxCommandEvent&);

BEGIN_DECLARE_EVENT_TYPES()
	DECLARE_EVENT_TYPE(EVENT_NAME_CATEGORY_CHANGED, 801)
END_DECLARE_EVENT_TYPES()

#define EVT_CATEGORY_CHANGED(id, fn)		\
	DECLARE_EVENT_TABLE_ENTRY(		\
		EVENT_NAME_CATEGORY_CHANGED,		\
		id,			\
		-1,			\
		(wxObjectEventFunction)(wxEventFunction)(CategoryChangedEventHandler)&fn,		\
		(wxObject*)NULL		\
		),

class CHeader : public wxPanel
{
public:
	virtual ~CHeader(void);

private:
	enum
	{
		BUTTON_1 = 1,
		BUTTON_2,
		BUTTON_3,
		BUTTON_4,
	};

	wxList m_buttons;

public:
    CHeader( 
		wxWindow *parent, wxWindowID id = 1, 
		const wxPoint& pos = wxDefaultPosition, 
		const wxSize& size = wxDefaultSize, 
		long style = wxTAB_TRAVERSAL
		);

	void CreateButtons();

	std::map<int, OperationCategory::Base*> m_map1;

private:
	void OnCreate(wxWindowCreateEvent& event);
	void OnButtonClicked(wxCommandEvent& event);
    DECLARE_EVENT_TABLE()
};